$(document).ready(function(){var pages=[['#pHome',gPageHome],['#pLogIn',gPageLogIn],['#pSubPage',gPageSubPage]];for(var i=0;i=0;var isFirefox=typeof InstallTrigger!=='undefined';var isSafari=Object.prototype.toString.call(window.HTMLElement).indexOf('Constructor')>0;var isChrome=!!window.chrome;var isIE=/*@cc_on!@*/false;if(OSName=="MacOS"&&isChrome==true) {$('body').addClass('chrome_Mac');} else if(OSName=="MacOS"&&isChrome==true) {$('body').addClass('chrome_Mac');}});$(window).load(function(){showPu();$('.popUp .btnClose,.ovl').click(function(){hidePu();});}) var settings={};var util={object:{exists:function(obj){return $(obj)!=undefined&&$(obj)!=null;}},common:{commonInit:function(){$('input[placeholder], textarea[placeholder]').placeholder();},setupCurrentYear:function(objId){if(util.object.exists(objId)){now=new Date;theYear=now.getYear();if(theYear<1900) theYear=theYear+1900;$(objId).text(theYear);}},linkPageFadeout:function(objClass){$(objClass).click(function(){var href=$(this).attr('href');var target=$(this).attr('target');setTimeout('goToURL()',1500);goToURL=function(){if(target=='_blank'){window.open(href,target);window.parent.location.reload();} else{window.location.reload();window.location=href;}} return false;});},measureText:function(pText,pFontSize,pStyle){var lDiv=document.createElement('lDiv');document.body.appendChild(lDiv);if(pStyle!=null){lDiv.style=pStyle;} lDiv.style.fontSize=""+pFontSize+"px";lDiv.style.position="absolute";lDiv.style.left=-1000;lDiv.style.top=-1000;lDiv.innerHTML=pText;var lResult={width:lDiv.clientWidth,height:lDiv.clientHeight};document.body.removeChild(lDiv);lDiv=null;return lResult;},customSelect:function(){$(".custom-select").each(function(){$(this).wrap("");$(this).after("");});$(".custom-select").change(function(){var selectedOption=$(this).find(":selected").text();$(this).next(".holder").text(selectedOption);}).trigger('change');},hoverSubmenu:function(){$('.hasub').hover(function(){$(this).find('.suvNav').show();$('.ctSubnav').show();},function(){$(this).find('.suvNav').hide();$('.ctSubnav').hide();});}},widget:{setupScroll:function(objClass){if(util.object.exists(objClass)){var ginScroll=$(objClass);ginScroll.tinyscrollbar();ginScroll.tinyscrollbar_update();}},initDot:function(){[].slice.call(document.querySelectorAll('.dotstyle > ul')).forEach(function(nav){new DotNav(nav,{callback:function(idx){}});});}}};var mobile={global:{navBtn:function(){var $navBtn=$('.mNavBtn'),$exitOffCanvas=$('.exit-off-canvas'),$offCanvas=$('.off-canvas-wrap');$navBtn.bind('click',function(e){e.preventDefault();$offCanvas.addClass('move-left');$(this).delay(200).animate({opacity:'1'},function(){$(this).addClass('active');});}) $exitOffCanvas.bind('click',function(e){e.preventDefault();$offCanvas.removeClass('move-left');$(this).delay(200).animate({opacity:'1'},function(){$navBtn.removeClass('active');});})}}} var ui={gPageHome:{init:function(){}},gPageLogIn:{widthLogin:function(){var hs=getDocumentSize(3),hHdFt=$('header').height()+$('footer').height();$('.ct_login').css({'height':hs-hHdFt});}}} $(function(){util.common.hoverSubmenu();mobile.global.navBtn();});function gPageHome(){ui.gPageHome.init();} function gPageLogIn(){$(".background-image").fullscreenBackground();ui.gPageLogIn.widthLogin();$(window).resize(function(){ui.gPageLogIn.widthLogin();});} function gPageSubPage(){customSelect();toolTip();$("#txtNgay").datepicker({onSelect:function(){var dateObject=$(this).datepicker({dateFormat:'yy-mm-dd'}).val();$("#txtNgay").val(dateObject);}});} function customSelect(){$(".custom-select").each(function(){$(this).wrap("");$(this).after("");});$(".custom-select").change(function(){var selectedOption=$(this).find(":selected").text();$(this).next(".holder").text(selectedOption);}).trigger('change');} function toolTip(){$('.helpForm').hover(function(){$(this).find('.ctTooltip').show();},function(){$(this).find('.ctTooltip').hide();});} function isNumeric(input){var number=/^\-{0,1}(?:[0-9]+){0,1}(?:\.[0-9]+){0,1}$/i;var regex=RegExp(number);return regex.test(input)&&input.length>0;} Number.prototype.format=function(n,x){var re='\\d(?=(\\d{'+(x||3)+'})+'+(n>0?'\\.':'$')+')';return this.toFixed(Math.max(0,~~n)).replace(new RegExp(re,'g'),'$&,');};var mangso=['không','một','hai','ba','bốn','năm','sáu','bảy','tám','chín'];function doubleblank(str){var i=0;var stmp1='',stmp2='';var lentmp=str.length;while(i1){chuoi=" "+mangso[chuc]+" mươi";if(donvi==1){chuoi+=" mốt";}}else if(chuc==1){chuoi=" mười";if(donvi==1){chuoi+=" một";}}else if(daydu&&donvi>0){chuoi=" lẽ";} if(donvi==5&&chuc>=1){chuoi+=" lăm";}else if(donvi>1||(donvi==1&&chuc==0)){chuoi+=" "+mangso[donvi];} return chuoi;} function docblock(so,daydu){var chuoi="";tram=Math.floor(so/100);so=so%100;if(daydu||tram>0){chuoi=" "+mangso[tram]+" trăm";chuoi+=dochangchuc(so,true);}else{chuoi=dochangchuc(so,false);} return chuoi;} function dochangtrieu(so,daydu){var chuoi="";trieu=Math.floor(so/1000000);so=so%1000000;if(trieu>0){chuoi=docblock(trieu,daydu)+" triệu";daydu=true;} nghin=Math.floor(so/1000);so=so%1000;if(nghin>0){chuoi+=docblock(nghin,daydu)+" nghìn";daydu=true;} if(so>0){chuoi+=docblock(so,daydu);} return chuoi;} function docso(so){if(so==0) return' '+mangso[0];var chuoi="",hauto="";do{ty=so%1000000000;so=Math.floor(so/1000000000);if(so>0){chuoi=dochangtrieu(ty,true)+hauto+chuoi;}else{chuoi=dochangtrieu(ty,false)+hauto+chuoi;} hauto=" tỷ";}while(so>0);return chuoi;} function isNumberKey(evt){var charCode=(evt.which)?evt.which:event.keyCode;if(charCode>31&&(charCode<48||charCode>57)) return false;return true;} function changeAmount(value){loValue=formatCurrency(value.replace(/,/g,"").replace(/\./g,""));loValue=loValue.replace(/,/g,".") return loValue;} function checkLength(form){if(form.Description.value.length>=117-form.glbHoTenKH.value.length) {len=form.Description.value.length-1;form.Description.value=form.Description.value.substr(0,len);return false;} return true;} function showPu(){$('.ovl').fadeIn();$('.popUp').show();$('.popUp').animate({left:'50%',opacity:1,});} function hidePu(){$('.popUp').animate({left:'10%',opacity:0,},500,function(){$('.ovl').fadeOut();$('.popUp').hide();$('.popUp').css({'left':'90%','opacity':0,'z-index':-1});});}